﻿namespace Chapter01.DesignMode {
    public abstract class Duck {
        public IFlyBehavior? FlyBehavior { get; set; }

        public IQuackBehavior? QuackBehavior { get; set; }

        public void PerformQuack() {
            QuackBehavior?.Quack();
        }

        public void PerformFly() {
            FlyBehavior?.Fly();
        }

        public void Swin() {
            Console.WriteLine("All ducks float, even decoys!");
        }

        public abstract void Display();
    }
}
